<?php 


$title = '新闻详情';

$css = 'news_details';

$tpid =3;
/********************************************************二级菜单************************************************/


	//header 当前状态效果
	$hid =isset($_GET['hid'])?$_GET['hid']:$tpid;
	//当前页类信息
	
	$curcate = dbselOne($con,'category','*',$tpid);

	//二级类信息
	$secondary = dbselect($con,'category','*',"pid=$tpid");
	
	//二级菜单当前状态效果
	$sid = isset($_GET['sid'])?$_GET['sid']:$secondary[0]['id'];

	//获取查询新闻数据id
	$id = isset($_GET['id'])?$_GET['id']:1;
	//查询id
	$data = dbselOne($con,'news','title,content,create_time,edit,reporter,correspondent,img_path',"$id");

	//当前二级类信息

	$cursec = dbselOne($con,'category','*',$sid);



/*************************上一页 下一页*************/
	//dbselect($con,'news','title,id',"id<$id",'create_time desc','0,1')
	$prevnews = dbselect($con,'news','id',"id<$id and category_id=$sid ",'create_time desc','0,1');		//上一篇

	if(empty($prevnews)){
		$prev = 0;
	}else{
		$prev = $prevnews[0];  //上一篇
	}



	$nextnews = dbselect($con,'news','id',"id>$id and category_id=$sid",'','0,1');  //下一篇

	if(empty($nextnews)){
		$next = 0;
	}else{
		$next = $nextnews[0];	//下一篇
	}


	//banner图查询
	$banner = dbselect($con,'banner','*',"cate_id='{$hid}' and status = 1",'create_time desc','1');

	



require("application/home/views/public/header.html");

include("application/".M."/views/".C."/".V.".html");

require("application/home/views/public/footer.html");


?>